	var xHRObject2 = new XMLHttpRequest();
	
	function showSlots(setName, setOwnerUserName, divId, loggedInUserName)
	{
		xHRObject2.open("GET", "ManageTrackAjaxServlet?getSetSlots&setName="+encodeURIComponent(setName)+"&setOwnerUserName=" + encodeURIComponent(setOwnerUserName) ) ;
    
		xHRObject2.onreadystatechange = function() {
			if (xHRObject2.readyState == 4) {
				if (xHRObject2.status == 200) {
					getData2(divId, loggedInUserName, setName, setOwnerUserName);
				}
			}
		};
		xHRObject2.send(null);
	}
	
	function getData2(divId, loggedInUserName, setName, setOwnerUserName)
	{
		try{
            var serverResponse = xHRObject2.responseXML;
            
            var header = serverResponse.getElementsByTagName("slot");
            
            var divSlots = document.getElementById(divId);
            divSlots.innerHTML = "";
            
            for (i=0; i<header.length; i++) {
            	divSlots.innerHTML += "<div class=\"slot\">"
            						+ "<p class=\"bold\" id=\"description"+header[i].childNodes[2].textContent+header[i].childNodes[4].textContent+"\">"+header[i].childNodes[0].textContent+" with an average rating of <img src=\"http://chart.apis.google.com/chart?chs=100x50&chxt=x&chxl=0:|0|1|2|3|4|5&chxp=0,0,20,40,60,80,100&cht=bhs&chd=t:"+header[i].childNodes[5].textContent+"&chds=0,5&chm=N*f2*,000000,0,-1,11\"/></p>"
            						+ "<script type=\"text/javascript\" src=\"http://192.168.1.1:5080/Meevle/com/meevle/web/audioplayer/audio-player.js\"></script>"
            						+ "<object type=\"application/x-shockwave-flash\" data=\"http://192.168.1.1:5080/Meevle/com/meevle/web/audioplayer/player.swf\" id=\"audioplayer1\" height=\"24\" width=\"290\">"
            						+ "<param name=\"movie\" value=\"http://192.168.1.1:5080/Meevle/com/meevle/web/audioplayer/player.swf\">"
            						+ "<param name=\"FlashVars\" value=\"playerID=1&amp;soundFile="+header[i].childNodes[2].textContent+"/"+header[i].childNodes[3].textContent+"\">"
            						+ "<param name=\"quality\" value=\"high\">"
            						+ "<param name=\"menu\" value=\"false\">"
            						+ "<param name=\"wmode\" value=\"transparent\">"
            						+ "</object>"

            						

            						+ "<div id=\"comments"+header[i].childNodes[2].textContent+header[i].childNodes[4].textContent+"\">"
            						+ "<p>Comments on: "+header[i].childNodes[0].textContent+" ("+header[i].childNodes[1].textContent+") <a onclick=\"getComments('"+setName+"','"+header[i].childNodes[2].textContent+"','"+header[i].childNodes[4].textContent+"','"+header[i].childNodes[0].textContent+"','"+header[i].childNodes[1].textContent+"','"+loggedInUserName+"')\">Comments</a></p>"
            						+ "</div><!-- end commentsDiv -->"
            						+ "</div><!-- end slotDiv -->";
            }
          //reset button					
            divSlots.innerHTML += "<button class=\"submit\" onclick=\"hideSlots('"+divId+"','"+setName+"','"+setOwnerUserName+"','"+loggedInUserName+"')\">Hide Slots</button>";
            
		}catch(e){}
        finally{//Clear the object and call the checkMessages function in 5 seconds
            xHRObject2.abort();
        }
	}
	
	function hideSlots(divId, setName, setOwnerUserName, loggedInUserName)
	{
		var div = document.getElementById(divId);
		div.innerHTML = "";
		div.innerHTML += "<button class=\"submit\" onclick=\"showSlots('"+setName+"','"+setOwnerUserName+"','set"+setName+setOwnerUserName+"','"+loggedInUserName+"')\">Show Slots</button>";
	}